﻿using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using btnet;

/// <summary>
/// Summary description for admin
/// </summary>
public partial class admin : System.Web.UI.Page
{
    protected Security security;
    protected bool nag = false;

    ///////////////////////////////////////////////////////////////////////
    void Page_Load(Object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            String footer_label = null;
            if (Application["custom_footer"] != null)
            {
                footer_label = (String)Application["custom_footer"];
            }
            custom_footer_label.Text = footer_label;
        }

        Util.do_not_cache(Response);

        security = new Security();
        security.check_security(HttpContext.Current, Security.MUST_BE_ADMIN);

        titl.InnerText = Util.get_setting("AppTitle", "BugTracker.NET") + " - "
            + "admin";

        if (false) // change this to if(true) to make the donation nag message go away
        {

        }
        else
        {
            int bugs = Convert.ToInt32(btnet.DbUtil.execute_scalar("select count(1) from bugs"));
            if (bugs > 100)
            {
                nag = true;
            }
        }
    }
}
